import java.util.Scanner ; 
public class Main {
    
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in) ;
        int n = scan.nextInt();
        int m = scan.nextInt() ;
        char[][] nums = new char[n][m] ;
        scan.nextLine();
        for(int i=0 ; i<n ; i ++){
            String str = scan.nextLine();
            nums[i] = str.toCharArray();
        }
        int sum = 0 ;
        for(int i=1 ; i < n ; i ++){
            for(int j=1 ; j<m ; j ++){
                if(nums[i][j] == '*' && nums[i-1][j]=='*' &&
                   nums[i-1][j-1]=='*' && nums[i][j-1]=='*'){
                    sum ++ ;
                }
            }
        }
        
        System.out.println(sum) ; 
    } 

}
